package com.alipay.sofa.award.endpoint.holder;

import com.alipay.sofa.award.common.dal.dataobject.UserInfo;

/**
 * AlipayMiniProgramUserHolder
 *
 * @author yangguanchao
 * @since 2018/09/05
 */
public class AlipayMiniProgramUserHolder {

    private static final ThreadLocal<UserInfo> USER_INFO_THREAD_LOCAL = new ThreadLocal<UserInfo>();

    public static void setUserInfo(UserInfo userInfo) {
        USER_INFO_THREAD_LOCAL.set(userInfo);
    }

    public static UserInfo getUserInfo() {
        return USER_INFO_THREAD_LOCAL.get();
    }

    public static void remove() {
        USER_INFO_THREAD_LOCAL.remove();
    }
}